package com.itheima.a01oopextensdemo2;

public class Text {
    public static void main(String[] args) {
        Zi z1 = new Zi("zhangsan",24);//子类不能继承父类的构造方法,构造方法的名字要与类名相同
    }
}



class Fu {
    String name;
    int age;

    public Fu() {
    }

    public Fu(String name, int age) {
        this.name = name;
        this.age = age;
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return age
     */
    public int getAge() {
        return age;
    }

    /**
     * 设置
     * @param age
     */
    public void setAge(int age) {
        this.age = age;
    }

    public String toString() {
        return "Fu{name = " + name + ", age = " + age + "}";
    }
}


class Zi extends Fu{

    public Zi(String zhangsan, int i) {
    }
}